<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<head>
<title>Market place</title>
</head>
<f:view>
	<body>
		<ui:composition>
			<p:dialog header="Choose a location" widgetVar="locationDlg"
				resizable="false" id="locationDialog" showEffect="explode"
				hideEffect="clip" modal="false" style="width:1000px;height:500px"
				rendered="#{locationModel.isInitialized}">
				<p:dataTable var="location" value="#{locationModel.list}" paginator="true" rows="10"
			rowsPerPageTemplate="5,7,10,15,20,30,40,50"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowKey="#{location.id}"
					selection="#{orderModel.orderQuery.location}"
					selectionMode="single" style="font:0.8em">
					<p:ajax event="rowSelect" update=":listForm,:headerForm"></p:ajax>
					<p:column headerText="No." style="max-width:50px">
						<h:outputText value="#{location.number}" />
					</p:column>
					<p:column headerText="type" sortBy="#{location.type}">
						<h:outputText value="#{location.type}" />
					</p:column>
					<p:column headerText="name" sortBy="#{location.name}">
						<h:outputText value="#{location.name}" />
					</p:column>
					<p:column headerText="district" sortBy="#{location.district}">
						<h:outputText value="#{location.district}" />
					</p:column>
					<p:column filterBy="#{location.address}" filterMatchMode="contains">
						<h:outputText value="#{location.address}" />
					</p:column>
					<p:column filterBy="#{location.pickupScheduleLabel}"
						filterMatchMode="contains">
						<h:outputText value="#{location.pickupScheduleLabel}" />
					</p:column>
				</p:dataTable>
				<p:commandButton value="OK" ajax="true"
					update=":detailForm,:headerForm" oncomplete="locationDlg.hide()"
					style="float:left" />
				<p:commandButton value="Cancel" type="button"
					onclick="locationDlg.hide()" style="float:right" />
			</p:dialog>
		</ui:composition>
	</body>
</f:view>
</html>